const db = wx.cloud.database();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    test_list:null,
    type:null,
    level:0
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
   
    //改变标题title
    wx.setNavigationBarTitle({
      title: options.title
    });


    let that = this;
    let type = options.type;
    var filter = {};
    filter.type = type;
    db.collection('test_list').where(filter).get().then(res => {
      that.setData({
        test_list: res.data
      });
    })
  }
})